<template>
  <span>{{text}}</span>
</template>

<script>
import Collection from 'lodash/collection'
export default {
  props: ['typeCode', 'value'],
  data () {
    return {
    }
  },
  computed: {
    text () {
      if (this.value) {
        this.chooseValue = this.value
        let result = JSON.parse(wx.getStorageSync('dics'))
        if (result) {
          let dic = Collection.filter(result, { type: this.typeCode, value: this.value.toString() })
          if (dic && dic.length > 0) {
            return dic[0].code
          } else {
            return this.value
          }
        } else {
          return this.value
        }
      }
      return this.value
    }
  }
}
</script>

<style>
</style>
